package demo2;

public class Test {
    public static void main(String[] args) {
        Integer aa = 128;
        Integer bb = 128;
        System.out.println(aa == bb);
        Integer a = 127;
        Integer b = 127;
        System.out.println(a == b);
    }
    public static void main2(String[] args) {
        Integer a = 99;
        //自动拆箱
        int b = a;
        int b2 = (int)a;
        //显式拆箱
        int c = a.intValue();
        double d = a.doubleValue();
    }
    public static void main1(String[] args) {
        int a = 6;
        //自动装箱
        Integer b = a;
        Integer b2 = (Integer)a;

        //显式装箱,调用valueOf()方法
        Integer d = Integer.valueOf(888);
        Integer d2 = Integer.valueOf(a);
        Integer d3 = new Integer(a);//已弃用，避免使用
        System.out.print("d"+d+" b"+b);
        System.out.println(d3);
    }
}
